package chapter7.quarter2;

import java.io.*;

public class Objectser implements Serializable {
    public static void main(String[] args) {
        Student stu=new Student(3658335,16,"Li Ming","CSD");
        try{
            FileOutputStream fo=new FileOutputStream("data.ser");
            ObjectOutputStream so=new ObjectOutputStream(fo);

            so.writeObject(stu);
            so.close();
            fo.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
